<?php
/*
 * Ce widget est utilisé pour afficher un label
 */
class sfWidgetLabel extends sfWidgetForm
{
	
  protected function configure($options = array(), $attributes = array())
  {
  	$this->addRequiredOption('text');
  	parent::configure($options, $attributes);
  }
  
  public function render($name, $value = null, $attributes = array(), $errors = array())
  {
  	$attributes = array_merge($this->attributes, $attributes);
  	
  	$result = "<label ";
  	foreach($attributes as $htmlKey => $htmlValue)
  		$result .= "$htmlKey= \"$htmlValue\" ";
  	
  	$result .= ">".$this->getOption('text')."</label>";
  	
  	return $result;
  }
}